<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
    </head>
    <body>
    <script type="text/javascript">
        var extend=function(target,source){
            for(var p in source){
                target[p]=source[p]
            }
            return target
        }
        var book={name:'sb',alike:[1,2,3]};
        var anotherbook={color:'123'};
        // var anotherbook1=extend(anotherbook,book)
        // console.log(anotherbook1.alike)
        //多继承
        //
        Object.prototype.mix=function(){
            var i=0,
                len=arguments.length,
                arg;
            for(;i<len;i++){
                arg=arguments[i]
                for(var p in arg){
                    this[p]=arg[p]
                }
            }
        }
         var ohterbook={};
         ohterbook.mix(book,anotherbook)
         console.log(ohterbook);
         var fn=12;
         function fn(){console.log('ok')};
         console.log(fn)
    </script>
    </body>
</html>